home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Format (UK) 75
/
PC Format 75 - Nov 1997.iso
/
Tech
/
WM30DEMO
/
KRSTART.WBS
< prev
next >
Wrap
Text File
|
1996-04-09
|
2KB
|
53 lines
Sub Main()
dim wmdirectory as string, sep as string
dim currentdirectory as string
currentdirectory = CurDir$
if basic.os = ebWin16 or basic.os = ebWin32 then
wmdirectory = wm.StartupDirectory
else
wmdirectory = CurDir$
end if
ChDir(wmdirectory)
sep = Basic.PathSeparator$ ' Stores the appropriate path separator for this platform
' Define all the files with a wbs extension inside the scripts directory/folder
If (Dir$("SCRIPTS", ebDirectory) = "SCRIPTS") THEN ' The directory/folder SCRIPTS exists
Dim f(20) as string, fullname as string, scriptdir as string
scriptdir = wmdirectory + sep + "SCRIPTS"
ChDir(scriptdir) 'Set to the SCRIPT directory
f(1) = Dir$("*.wbs") ' Find the first file with a .wbs extension
i% = 1
While (f(i) <> "") And (i < 20) 'Define the first 20 scripts found
fullname = scriptdir + sep + f(i)
WM.InsertMenuItem i, f(i), fullname
i = i+1
f(i) = Dir$ ' Get next file with a .wbs extension
Wend
End If
' Define the "Official KR" scripts
' Demo scripts
Dim krscripts as string
krscripts = scriptdir + sep + "KRDEMOS"
If (Dir$("KRDEMOS",ebDirectory) = "KRDEMOS") then ' The directory/folder KRDEMOS exists
WM.InsertMenuItem 1,"Optimize", krscripts + sep + "optimize.wbs"
WM.InsertMenuItem 2,"Create Constraint", krscripts + sep + "bldcons.wbs"
WM.InsertMenuItem 3,"Document Model", krscripts + sep + "docinfo.wbs"
WM.InsertMenuItem 4,"Zoom to Extent", krscripts + sep + "krzoom.wbs"
WM.InsertMenuItem 5,"Measure Between Points", krscripts + sep + "measure.wbs"
WM.InsertMenuItem 6,"Multiple File Run", krscripts + sep + "repeat.wbs"
WM.InsertMenuItem 7,"Flip Polygon", krscripts + sep + "flipoly.wbs"
end If
' Run the User startup file
dim userstartup as string
userstartup = wmdirectory + sep + "startup.wbs"
If FileExists(userstartup) then
wm.RunScript userstartup
end If
' Run the demonstration script
dim demotour as string
demotour = krscripts + sep + "demo.wbs"
If FileExists(demotour) then
wm.RunScript demotour
end If
ChDir(currentdirectory)
End Sub